<div class="bg-light lter b-b wrapper-md">
    <h4 class="m-n font-thin">粉丝管理</h4>
</div>
<div class="wrapper-md ng-scope" ng-controller="userCtrl">
    <div class="panel panel-default">
        <div class="row wrapper">
            <div class="col-sm-9">
                <form class="form-inline">
                    <div class="form-group">
                        <label class="control-label">昵称</label>
                        <input type="text" ng-model="user.nickName" class="input-sm form-control">
                    </div>
                    <div class="form-group">
                        <label class="control-label">手机号码</label>
                        <input type="text" ng-model="user.mobilePhone" class="input-sm form-control">
                    </div>
                    <div class="form-group">
                        <label class="control-label">用户编号</label>
                        <input type="text" ng-model="user.code" class="input-sm form-control">
                    </div>
                    <div class="form-group">
                        <label class="control-label">身份类型</label>
                        <select class="form-control" ng-model="user.vipIdentity"
                                ng-options="item.value as item.name for item in identityObject">
                            <option value="">--请选择--</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label class="control-label">性别</label>
                        <select class="input-sm form-control" ng-model="user.sex">
                            <option value="">全部</option>
                            <option value="0">未知</option>
                            <option value="1">男</option>
                            <option value="2">女</option>
                        </select>
                    </div>
                    <button class="btn btn-sm btn-default" ng-click="query()">查询</button>
                </form>
            </div>
            <div class="col-sm-3">
                <div class="pull-right">
                    <!--<button class="btn btn-sm btn-info">批量打印小票</button>-->
                </div>
            </div>
            <div class="clearfix"></div>
        </div>
        <div class="table-responsive">
            <table class="table table-striped b-t b-light">
                <thead>
                <tr>
                    <th width="100px;">头像</th>
                    <th>用户信息</th>
                    <th>真实信息</th>
                    <!--<th>累计收益金额</th>-->
                    <th>当前收益积分</th>
                    <th>累计收益积分</th>
                    <th>是否商家</th>
                    <th>状态</th>
                    <th>关注状态</th>
                    <th width="200">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="u in list">
                    <td><img ng-src="{{u.avatarUrl}}" err-src="img/error.png"></td>
                    <td>
                        昵称:{{u.nickName}}<br>
                        编号:{{u.code}}<br>
                        性别:<span ng-if="u.sex == 0">未知</span>
                        <span ng-if="u.sex == 1">男</span>
                        <span ng-if="u.sex == 2">女</span><br>
                        <span ng-if="u.areaName == null">地区:{{u.country}} {{u.province}} {{u.city}}</span>
                        <span ng-if="u.areaName != null">地区:{{u.areaName}}</span>
                    </td>
                    <td>
                        <span ng-if="u.name != null">姓名：{{u.name}}<br></span>
                        <span ng-if="u.name == null">未填写真实姓名<br></span>
                        <span ng-if="u.mobilePhone != null">联系方式：{{u.mobilePhone}}<br></span>
                        <span ng-if="u.mobilePhone == null">未绑定联系方式<br></span>
                        <span ng-if="u.vipIdentity == 0">身份：普通用户</span>
                        <span ng-if="u.vipIdentity == 1">身份：VIP用户</span>
                        <span ng-if="u.vipIdentity == 2">身份：渠道合伙人</span>
                    </td>
                    <!--<td>-->
                        <!--分销奖励：￥{{u.pileSellMoney | number:2}}<br>-->
                        <!--流水奖励：￥{{u.pileIncomeMoney | number:2}}<br>-->
                        <!--返利奖励：￥{{u.pileRebateMoney | number:2}}-->
                    <!--</td>-->
                    <td>
                        现金分：{{u.currentMoney}}<br>
                        收益分：{{u.withdrawalMoney | number:2}}<br>
                        乐积分：{{u.legeIntegral}}
                    </td>
                    <td>
                        现金分：{{u.pileMoney}}<br>
                        <!--收益分：{{u.pileSellMoney+u.pileIncomeMoney+u.pileRebateMoney | number:2}}<br>-->
                        乐积分：{{u.pileLegeIntegral}}
                    </td>
                    <td>
                        <span class="label bg-light" ng-class="{0:'bg-light',1:'bg-success'}[u.isShop]"
                              ng-bind="{0:'否',1:'是'}[u.isShop]"></span>
                    </td>
                    <td>
                        <span class="label bg-success" ng-if="u.status == 1">已激活</span>
                        <span class="label bg-danger" ng-if="u.status == 0">未激活</span>
                    </td>
                    <td>
                        关注状态：{{u.subscribe == 0?'未关注':'已关注'}}<br>
                        关注时间：{{u.subscribeTime}}
                    </td>
                    <td class="t-btns" ng-controller="ModalDemoCtrl">
                        <a class="btn btn-sm btn-info" ui-sref="app.userCoupons({userId:u.id})" target="_blank">赠送优惠券</a>
                        <div class="btn-group dropdown" dropdown="">
                            <button class="btn btn-sm btn-default" dropdown-toggle="" aria-haspopup="true" aria-expanded="false">更多 <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu">
                                <li><a ng-click="updateUserIdentity(u.id,u.name,u.mobilePhone,u.vipId,u.vipIdentity)">设置身份</a></li>
                            </ul>
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
            <div ng-if="list.length<=0 && !app.loading" class="padder-v text-center">
                <span class="h6">~未搜索到任何数据~</span>
            </div>
            <div>
                <circle-loading ng-if="app.loading"></circle-loading>
            </div>
        </div>
        <footer class="panel-footer">
            <div class="row">
                <div class="col-sm-4 hidden-xs">
                    <!--<button class="btn btn-sm btn-default">批量冻结</button>
                    <button class="btn btn-sm btn-default">批量删除</button>-->
                </div>
                <div class="col-sm-4 text-center">
                    <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共 {{totalItems}}
                        项
                    </small>
                </div>
                <div class="col-sm-4 text-right text-center-xs">
                    <pagination boundary-links="true" total-items="totalItems" ng-model="currentPage"
                                ng-change="pageChanged()" max-size="{{maxPageRow}}" class="pagination-sm m-t-none m-b"
                                previous-text="上一页" next-text="下一页"
                                first-text="首页" last-text="尾页"></pagination>
                </div>
            </div>
        </footer>
    </div>
</div>


